{include file="public/head"/}
<div class="container-fluid" id="main">
    <div class="row clearfix" id="search-box" style="margin-top:0">
        <div class="col-md-12 column text-right">
            <div class="form-inline" style="text-align: right;">
                <div class="form-group">
                    <input type="text" class="form-control" id="searchText" @keyup.13="requestSearch" name="searchText" placeholder="{:lang("edit_product_properties")}">
                  </div>
                  <div class="form-group">
                      <button type="button" class="btn btn-default cz" @click="requestSearch"><span class="glyphicon glyphicon-search"></span> {:lang('search')}</button>
                  </div>
            </div>
        </div>
    </div>
  <div class="row clearfix">
    <div class="col-md-12 column">
      <div class="alert alert-dismissable alert-info">
        <button type="button" class="close">×</button>
         <p></p>
      </div>
    </div>
   </div>
   
   
  <div class="ntDesktop">
  <div class="ntDesktop-head" v-cloak>{:lang("product_properties")}</div>
   <div class="row clearfix" style="padding-top:12px">
    <div class="col-md-6 column">
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" :class="{'active':indexlanguage==0}" v-for="(itemlanguage,indexlanguage) in language_type">
                <a href="#lang_zh" data-toggle="tab" @click="changefn(itemlanguage.code)">{{itemlanguage.name}}</a>
            </li>
        </ul>
    </div>
    <div class="col-md-6 column text-right">
      <div>
          <a href="/admin/proattr/attrAdd?request=add"  class='btn btn-sm btn-primary' data-toggle="modal" data-target="#proatt_editModal">
              <span class="glyphicon glyphicon-plus"></span> {:lang("add_product_properties")}
            </a>
            <span style="padding:10px">&nbsp;</span>
            <button type="button" class="btn btn-default option-del" @click="ploption(2)">
                <span class="glyphicon glyphicon-remove-circle"></span> {:lang('batch_delete')}</button>
            <button type="button" class="btn btn-default option-pulloff" @click="ploption(4)">
                <span class="glyphicon glyphicon-minus-sign"></span> {:lang("delisted_in_bulk")}</button>
            <button type="button" class="btn btn-default option-recover" @click="ploption(1)">
                <span class="glyphicon glyphicon-ok-circle"></span> {:lang('batch_recovery')}</button>
            <button type="button" class="btn btn-danger option-clear" @click="ploption(5)">
                <span class="glyphicon glyphicon-fire"></span> {:lang('batch_clear')}</button>
        </div>
    </div>
  </div>
  <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="lang_zh"><table class="table table-striped table-hover ntTable">
                <thead>
                <tr>
                    <th style="text-align: center;"><input type="checkbox" @click="allsel" /> </th>
                    <th> {:lang("attribute_name")} </th>
                    <th> {:lang("attribute_value")} </th>
                    <th> <a href="#" data-toggle="tooltip" data-placement="top" title="关联产品分类数量">{:lang('product_category_name')}</a> </th>
                    <th> <a href="#" data-toggle="tooltip" data-placement="top" title="{:lang("related_product_quantity")}">{:lang("related_product_quantity")}</a> </th>
                    <th> {:lang('universal')} </th>
                    <th> {:lang('delete')} </th>
                    <th> {:lang('status')} </th>
                    <th style="text-align: center;"> {:lang('operate')} </th>
                    </tr>
                </thead>
                <tbody>
                  <tr v-for="(item,index) in listdata" :key="item.id+lang" v-cloak>
                    <td style="text-align: center;" class="chebox"><input type="checkbox" @click="onesel(item.id)" /></td>
                    <td>{{item.content}}</td>
                    <td align="left">{{item.childname}}</td>
                    <td >{{item.product_cate}}</td>
                    <td >{{item.cateCount}}</td>
                    <td :style="{color: item.is_public == 'P' ? 'blue' : ''}" >{{item.is_public}}</td>
                    <td :style="{color: item.is_del == 'D' ? 'red' : ''}" >{{item.is_del}}</td>
                    <td >{{item.status_name}}</td>
                    <td class="text-right">
                        <div>
                          <a :href="'/admin/proattr/attrEdit?request=edit&id='+item.id" class='btn btn-sm btn-primary' data-toggle="modal" data-target="#proatt_editModal"><span class="glyphicon glyphicon-pencil"></span> {:lang('edit')}</a>
                          <a  :href="'/admin/proattr/attrBindType?request=list&id='+item.id" class='btn btn-sm btn-primary' data-toggle="modal" data-target="#proatt2catModal"><span class="glyphicon glyphicon-indent-left"></span> {:lang("specify_product_category")}</button>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='3'" @click="restore(item.id,3,item.content)"><span class="glyphicon glyphicon-eye-close"></span> {:lang("hide")}</a>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='1'" @click="restore(item.id,1,item.content)"><span class="glyphicon glyphicon-eye-close"></span> {:lang('recovery')}</a>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='4'" @click="restore(item.id,4,item.content)"><span class="glyphicon glyphicon-eye-close"></span> {:lang("off_the_shelf")}</a>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='2'" @click="restore(item.id,2,item.content)"><span class="glyphicon glyphicon-eye-close"></span> {:lang('delete')}</a>
                          <a href="javascript:;" class='btn btn-sm btn-danger option-clear' v-if="item.status=='2'" @click="restore(item.id,5,item.content)"><span class="glyphicon glyphicon-fire"></span> {:lang('clear')}</a>

                          </div>
                    </td>
                  </tr>
                  <tr style="text-align: center;" v-if="listdata.length==0">
                      <td colspan="9">{:lang('No_data')}</td>
                  </tr>
                </tbody>
              </table>
              <ul class="pagination" id="pagination">
                </ul>
            </div>
  </div>
</div>
</div>

<div>
    <div class="modal fade" id="proatt_editModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<!--详情弹窗部分 开始-->


<div>
    <div class="modal fade" id="proatt2catModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<script>
    $("#proatt_editModal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
        $(".modal-content").children().remove();
        $(document).unbind('keydown')
    });
    $("#proatt2catModal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
        $(".modal-content").children().remove();
        $(document).unbind('keydown')
    });
</script>


<!--弹窗部分 结束-->
<script src="/static/Admin/js/attrlist.js"></script>
{include file="public/foot"/}